import request from '@/utils/request'
const api_name = "/teacher"
export default {
    getList(page, limit, searchObj) {
        // 获取讲师列表数据
        return request({
            url: `${api_name}/list/${page}/${limit}`,
            method: "post",
            data: searchObj
        })

    },
    // 根据id删除讲师
    deleteById(id) {
        return request({
            url: `${api_name}/${id}`,
            method: "delete",

        })
    },
    // 添加讲师
    addTeacher(teacher) {
        return request({
            url: `${api_name}`,
            method: "post",
            data: teacher
        })

    },
    // 根据id查询讲师
    getTeacher(id) {
        return request({
            url: `${api_name}/${id}`,
            method: "get"
        })
    },
    // 更新讲师
    updateTeache(teacher) {
        return request({
            url: `${api_name}/${teacher.id}`,
            method: "put",
            data: teacher
        })
    },
    // 获取所以讲师基本信息
    listTeacher() {
        return request({
            url: `${api_name}/list`,
            method: "get"
        })
    }
}